.class Les/mg$h;
.super Ljava/lang/Thread;
.source "AppFolderInfoManager.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Les/mg;->a(Landroid/content/Context;Lcom/estrongs/fs/g;Ljava/lang/String;ZLes/mg$t;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic a:Ljava/lang/String;

.field final synthetic b:Ljava/lang/String;

.field final synthetic c:Lcom/estrongs/fs/g;

.field final synthetic d:Les/mg$t;

.field final synthetic e:Landroid/content/Context;

.field final synthetic f:Z

.field final synthetic g:Les/mg;


# direct methods
.method constructor <init>(Les/mg;Ljava/lang/String;Ljava/lang/String;Lcom/estrongs/fs/g;Les/mg$t;Landroid/content/Context;Z)V
    .locals 0

    .line 1
    iput-object p1, p0, Les/mg$h;->g:Les/mg;

    iput-object p2, p0, Les/mg$h;->a:Ljava/lang/String;

    iput-object p3, p0, Les/mg$h;->b:Ljava/lang/String;

    iput-object p4, p0, Les/mg$h;->c:Lcom/estrongs/fs/g;

    iput-object p5, p0, Les/mg$h;->d:Les/mg$t;

    iput-object p6, p0, Les/mg$h;->e:Landroid/content/Context;

    iput-boolean p7, p0, Les/mg$h;->f:Z

    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 6

    .line 1
    iget-object v0, p0, Les/mg$h;->g:Les/mg;

    iget-object v1, v0, Les/mg;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-nez v1, :cond_0

    .line 2
    invoke-virtual {v0}, Les/mg;->c()V

    .line 3
    :cond_0
    iget-object v0, p0, Les/mg$h;->g:Les/mg;

    iget-object v0, v0, Les/mg;->i:Ljava/util/concurrent/locks/Lock;

    invoke-interface {v0}, Ljava/util/concurrent/locks/Lock;->lock()V

    .line 4
    :try_start_0
    iget-object v0, p0, Les/mg$h;->g:Les/mg;

    iget-object v1, p0, Les/mg$h;->a:Ljava/lang/String;

    iget-object v2, p0, Les/mg$h;->b:Ljava/lang/String;

    invoke-static {v0, v1, v2}, Les/mg;->a(Les/mg;Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v0

    goto/16 :goto_2

    :catch_0
    move-exception v0

    .line 5
    :try_start_1
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 6
    :goto_0
    iget-object v0, p0, Les/mg$h;->g:Les/mg;

    iget-object v0, v0, Les/mg;->i:Ljava/util/concurrent/locks/Lock;

    invoke-interface {v0}, Ljava/util/concurrent/locks/Lock;->unlock()V

    const/4 v0, 0x0

    .line 7
    :try_start_2
    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object v1

    invoke-virtual {v1}, Landroid/app/Application;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v1

    .line 8
    iget-object v2, p0, Les/mg$h;->b:Ljava/lang/String;

    invoke-virtual {v1, v2, v0}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;

    move-result-object v2

    if-eqz v2, :cond_1

    .line 9
    iget-object v3, p0, Les/mg$h;->g:Les/mg;

    invoke-static {v3, v1, v2}, Les/mg;->a(Les/mg;Landroid/content/pm/PackageManager;Landroid/content/pm/PackageInfo;)V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    .line 10
    :catch_1
    :cond_1
    iget-object v1, p0, Les/mg$h;->c:Lcom/estrongs/fs/g;

    invoke-interface {v1}, Lcom/estrongs/fs/g;->d()Ljava/lang/String;

    move-result-object v1

    const-string v2, "/"

    .line 11
    invoke-virtual {v1, v2}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v3

    :goto_1
    if-lez v3, :cond_2

    .line 12
    invoke-virtual {v1, v0, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v4

    .line 13
    iget-object v5, p0, Les/mg$h;->g:Les/mg;

    iget-object v5, v5, Les/mg;->b:Landroid/util/LruCache;

    invoke-virtual {v5, v4}, Landroid/util/LruCache;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    add-int/lit8 v3, v3, -0x1

    .line 14
    invoke-virtual {v1, v2, v3}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;I)I

    move-result v3

    goto :goto_1

    .line 15
    :cond_2
    iget-object v2, p0, Les/mg$h;->g:Les/mg;

    iget-object v2, v2, Les/mg;->b:Landroid/util/LruCache;

    invoke-virtual {v2, v1}, Landroid/util/LruCache;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    .line 16
    iget-object v1, p0, Les/mg$h;->d:Les/mg$t;

    invoke-interface {v1}, Les/mg$t;->a()V

    .line 17
    iget-object v1, p0, Les/mg$h;->e:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v2, "android_id"

    invoke-static {v1, v2}, Landroid/provider/Settings$Secure;->getString(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 18
    iget-object v2, p0, Les/mg$h;->a:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->getBytes()[B

    move-result-object v2

    invoke-static {v2}, Lcom/estrongs/android/pop/netfs/utils/HttpUtils;->base64Encode([B)Ljava/lang/String;

    move-result-object v2

    const/4 v3, 0x3

    new-array v3, v3, [Ljava/lang/Object;

    .line 19
    invoke-static {v2}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    aput-object v2, v3, v0

    const/4 v0, 0x1

    iget-object v2, p0, Les/mg$h;->b:Ljava/lang/String;

    aput-object v2, v3, v0

    const/4 v0, 0x2

    aput-object v1, v3, v0

    const-string v0, "http://www.estrodds.com/console/service/app_folder/share.php?f=%s&a=%s&i=%s"

    invoke-static {v0, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    .line 20
    iget-boolean v1, p0, Les/mg$h;->f:Z

    if-eqz v1, :cond_3

    iget-object v1, p0, Les/mg$h;->b:Ljava/lang/String;

    if-eqz v1, :cond_3

    .line 21
    new-instance v1, Lcom/estrongs/android/util/a0;

    invoke-direct {v1, v0}, Lcom/estrongs/android/util/a0;-><init>(Ljava/lang/String;)V

    .line 22
    new-instance v0, Les/mg$h$a;

    invoke-direct {v0, p0}, Les/mg$h$a;-><init>(Les/mg$h;)V

    invoke-virtual {v1, v0}, Lcom/estrongs/android/util/a0;->a(Lcom/estrongs/android/util/a0$c;)V

    .line 23
    invoke-virtual {v1}, Lcom/estrongs/android/util/a0;->b()V

    :cond_3
    return-void

    .line 24
    :goto_2
    iget-object v1, p0, Les/mg$h;->g:Les/mg;

    iget-object v1, v1, Les/mg;->i:Ljava/util/concurrent/locks/Lock;

    invoke-interface {v1}, Ljava/util/concurrent/locks/Lock;->unlock()V

    .line 25
    goto :goto_4

    :goto_3
    throw v0

    :goto_4
    goto :goto_3
.end method
